12. Lesson Review
In this lesson we learned…
Why is poor performance such a problem?
In VR, a low FPS (frames per second) rate is more likely to induce simulator sickness and can break the sense of immersion for users.
How can we track performance issues?
FPS Display
A FPS display can help you track how your application runs as it’s running. To create one:
- Create a UI canvas, panel, and text. Be sure to set the canvas to world space, and resize it so you’re able to see it when in VR.
- Add a script that will track your FPS. Be sure to assign your text variable by dragging and dropping the Text element you created in the first step into the script’s text slot in the inspector.
public Text text;
private float fps;
private float deltaTime;
void Start() {
deltaTime = 0.0f;
}
void Update() {
// Calculates the number of frames each second at the given frame rate. We take or 1 second divided by our delta time (the time since the frame was rendered) to see how many frames we could render each second if each frame took the same time.
fps = Mathf.FloorToInt(1.0f / deltaTime);
text.text = fps.ToString();
deltaTime += (Time.deltaTime - deltaTime) * 0.1f;
}
What are the target frame rates for mobile and desktop?
For mobile, our target FPS is 60. For desktop, it’s 90 FPS.
Why is it so important to test a mobile VR experience on the device? Why can’t we just test it on the computer?
Computers have significantly more power than mobile devices. An app that runs at the target frame rate on a computer, may run really poorly on our mobile device. If we only tested on the computer, we wouldn’t be able to say for certain that our users wouldn’t get sick or that there aren’t major performance issues.
It’s vital to test our apps on our devices often to detect performance issues earlier. If we waited until the end, there could be many more possibilities for poor performance. If we test as we go by testing between smaller changes, we will know right away if we do something that causes a problem. It makes debugging so much easier.
Why do we need to consider the hardware when developing VR applications?
The Device’s Power
For mobile VR, an application can push our devices to its limits. We can optimize this in a variety of ways. For example, we can choose to only display or activate certain parts of the application.
The longer we can go without triggering a devices “low power mode”, the better experience users will have. The more complex the graphics, the more power draining the experience is on a device. Typically, the more things that move in a scene, the worse it is on performance because the GPU has to work harder to render the scene. Realtime lighting is also costly.
The Heat Problem
If you’ve played any VR experience for long enough, you’ve probably noticed that the device gets pretty hot. As the phone heats up, it can cause additional performance costs because of the (hot) physical environment inside the mobile device. Some devices have safeguards in place that will prevent users from continuing in VR until the phone cools down.
A common way to detect this is to watch the frame rate over a period of a couple of minutes. If the frame rate continues to decrease over the span of a few minutes, there’s likely a heat issue. You can confirm this my touching the phone after taking it out of the headset. It’s likely warm to the touch.